//
//  MainViewController.h
//  LegoClient
//
//  Created by Balazs Faludi on 30.12.09.
//  Copyright Universität Basel 2009. All rights reserved.
//

#import "FlipsideViewController.h"
#import "NetClient.h"
#import "NetConnection.h"
#import "NetMessage.h"
#import "NetCommand.h"
#import "AccelerometerFilter.h"

@class EAGLView;

/*typedef struct Acceleration {
	float x, y, z;
} Acceleration;*/

@class TiltIndicator;
@class RadarScene;

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate, NetClientDelegate, NetConnectionDelegate, UIAccelerometerDelegate >
{
	IBOutlet EAGLView *glView;
	
	NetClient *client;
	NetConnection *connection;
	
	UIAccelerometer *accelerometer;
	
	IBOutlet UIButton *neutralButton;
	//IBOutlet UIButton *onoffButton;
	IBOutlet UISlider *speedSlider;
	IBOutlet UISwitch *onoffSwitch;
	IBOutlet UISwitch *radarSwitch;
	BOOL isOn;
	IBOutlet TiltIndicator *tiltIndicator;
	float neutralAngle;
	UIAccelerationValue lastX, lastY;
	NSTimer *sendTimer;
	LowpassFilter *filter;
	RadarScene *radarScene;
}

- (IBAction)turnOnOff:(id)sender;
- (IBAction)showInfo;
- (IBAction)setNeutralAction:(id)sender;
- (IBAction)radarSwitchAction:(id)sender;
- (IBAction)setSpeedAction:(id)sender;

@end
